﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using WxTenpay.Common;
using WxTenpay.Service.Model;

namespace WxTenpay.Service.Service
{
    public class SysRole : BaseService<SysRoleEntity>, ISysRole
    {

        /// <summary>
        /// 获得列表——分页
        /// </summary>
        /// <param name="parm">PageParm</param>
        /// <returns></returns>
        public PageModel.Page<SysRoleEntity> GetRolePages(PageModel.PageParm parm)
        {

            var expression = Expressionable.Create<SysRoleEntity>();
            var query = parm.data.ToString().ToObject();

            if (!query["Name"].IsEmpty()) expression.And(u => u.Name.Contains(query["Name"].ToString()));


            return Db.Queryable<SysRoleEntity>().Where(expression.ToExpression()).ToPage(parm.page, parm.limit);

   

        }
    }
}
